angular.module('YYOA', [ 'ngRoute', 'ngCookies' ]).run(
		function($cookies, $rootScope) {
			$rootScope.title = "YYOA";
			$rootScope.userName = setNull($cookies.loginName);
			$rootScope.password = setNull($cookies.loginPwd);
			if ($cookies.loginRememberPwd != "\"\"") {
				$rootScope.rememberPwd = true;
			} else {
				$rootScope.rememberPwd = false;
			}

		}).config([ '$controllerProvider', function($controllerProvider) {
	$controllerProvider.allowGlobals();
} ]).config([ '$routeProvider', function($routeProvider) {
	$routeProvider.when('/login', {
		templateUrl : 'login.html',
		controller : 'LoginCtrl'
	}).otherwise({
		redirectTo : '/login'
	});
} ]);

function setNull(element) {
	if (element == "\"\"") {
		element = null;
	}
	return element;
}